#include "cLennardJones.h"

LennardJones::LennardJones()
{
	setName("Lennard-Jones Potential");
	//Epsilon and sigma for Ar atom at 0 K, 0 Pa.
	epsilon = 11.184;
	sigma = 36.23;
	setUniverse(4*sigma);
	setWidth(getUniverse());
	setPotLeft(0.1);
	setPotRight(getUniverse());
	setFx(getUniverse());
	setTx(getPotLeft());
        setUniLeft(0.1);
        setUniRight(getUniverse());
	setMinEnergy(-epsilon);
	//filter[activefilter]->calculate(this);
}

LennardJones::~LennardJones()
{
}

double LennardJones::getPotentialValueAt(double x){
	//double epsilon, sigma;
	//epsilon = 111.84;
	//sigma = 362.3;
	if(x<=2.5*sigma) { return  4.0*epsilon*(sigma*sigma*sigma*sigma*sigma*sigma*sigma*sigma*sigma*sigma*sigma*sigma/(x*x*x*x*x*x*x*x*x*x*x*x)
			- sigma*sigma*sigma*sigma*sigma*sigma/(x*x*x*x*x*x)) + 0.0163 * epsilon;}
	else return 0.0;
}

